Component({
    // 定义组件内部数据
    data:{
        name:'custom-component',
        paramA: '',
        // paramB: Number,
        background: [
            "demo-text-1",
            "demo-text-2",
            "demo-text-3",
            "demo-text-4",
            "demo-text-5",
            "demo-text-6",
        ],
        indicatorDots: false,
        autoplay: true,
        interval: 2000,
        duration: 500,
        current: 0,
        beforeColor: "rgba(0, 0, 0, .3)",
        afterColor: "coral",
        circular: false,
        vertical: false,
        previousmargin: "0px",
        nextmargin: "0rpx",
        displaymultipleitems: 1,
        easingfunction: "default",
        eventData: "",
        transition: "",
        animationfinish: "",
        disableTouch: false,
        srcimgList:[
            'https://img2.baidu.com/it/u=4046032575,170739907&fm=253&fmt=auto&app=138&f=JPEG?w=479&h=500',
            'https://img2.baidu.com/it/u=3341110453,3081826810&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
            'https://img.soogif.com/ECm8MKe1JrV57Hd0ItkPpRf47JDyRZo2.gif'
        ]
    },
    // 自定组件内部方法
    methods:{
      customFun(){
          //fangfa
      },
        onLoad: function () {
          console.log('pkl--onLoadparamA')
            // this.data.paramA ='加载成功'// 页面参数 paramA 的值
            // this.data.paramB // 页面参数 paramB 的值
        },
        onTap:function(){
          var myEventDetail = {}// detail对象，提供给事件监听函数
            var myEventOption = {} // 触发事件的选项
            this.triggerEvent('myevent',myEventDetail,myEventOption)
            console.log('pkl--myevent')
        }
    },
    changeIndicatorDots() {
        this.setData({
            indicatorDots: !this.data.indicatorDots,
        });
    },
    changeAutoplay() {
        this.setData({
            autoplay: !this.data.autoplay,
        });
    },
    changeCircular() {
        this.setData({
            circular: !this.data.circular,
        });
    },
    changeVertical() {
        this.setData({
            vertical: !this.data.vertical,
        });
    },
    changeDisableTouch() {
        this.setData({
            disableTouch: !this.data.disableTouch,
        });
    },
    intervalChange(e) {
        this.setData({
            interval: e.detail.value,
        });
    },
    durationChange(e) {
        this.setData({
            duration: e.detail.value,
        });
    },
    previousmarginChange(e) {
        this.setData({
            previousmargin: e.detail.value + "px",
            previousmargindata: e.detail.value,
        });
    },
    nextmarginChange(e) {
        this.setData({
            nextmargin: e.detail.value + "rpx",
            nextmargindata: e.detail.value,
        });
    },
    displaymultipleitemsChange(e) {
        this.setData({
            displaymultipleitems: e.detail.value,
        });
    },
    setDefault() {
        this.setData({
            easingfunction: "default",
        });
    },
    setLinear() {
        this.setData({
            easingfunction: "linear",
        });
    },
    setEaseInCubic() {
        this.setData({
            easingfunction: "easeInCubic",
        });
    },
    setEaseOutCubic() {
        this.setData({
            easingfunction: "easeOutCubic",
        });
    },
    setEaseInOutCubic() {
        this.setData({
            easingfunction: "easeInOutCubic",
        });
    },
    setCurrent() {
        this.setData({
            current: 1,
        });
    },
    changeCurrent(e) {
        // console.log('pkl---current',this.data.current,e.detail.current);
        this.setData({
            eventData: JSON.stringify(e.detail),

        });
    },
    bindtransition(e) {
        this.setData({
            transition: JSON.stringify(e.detail),
        });
    },
    bindanimationfinish(e) {
        this.setData({
            animationfinish: JSON.stringify(e.detail),
            current:e.detail.current
        });
    }
})